package io2;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
            String name = "azi";
            int age = 23;
            String gender = "女";
            String[] other = {"是个主播","来自中国","喜欢玩游戏"};

            Student az = new Student(name,age,gender,other);
            System.out.println(az);

            FileOutputStream fos = new FileOutputStream("student1.obj");
            ObjectOutputStream oos = new ObjectOutputStream(fos);
            oos.writeObject(az);
        System.out.println("写出完毕");
        oos.close();















//        String name = "nanami";
//        int age = 28;
//        String gender = "女";
//        String[] other = {"是个vtb","来自中国","喜欢唱歌"};
//
//        Student nnm = new Student(name,age,gender,other);
//        System.out.println(nnm);
//
//        FileOutputStream fos = new FileOutputStream("student.obj");
//        ObjectOutputStream oos = new ObjectOutputStream(fos);
//        oos.writeObject(nnm);
//        System.out.println("写出完毕");
//        oos.close();
    }
}
